package cn.laixueit;

import cn.laixueit.mapper.StudentMapper;
import cn.laixueit.servlet.StudentServlet;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class) // 测试运行环境
@ContextConfiguration(locations = {"classpath:spring.xml"})
public class Demo {

    @Autowired
    private StudentServlet studentServlet;

    @Test
    public void t(){
        studentServlet.save();
    }

    @Autowired
    private StudentMapper studentMapper;

    @Test
    public void t2(){
        studentMapper.save(null);
    }
}
